package com.quz.jn_travel.controller;

import com.quz.jn_travel.pojo.VO.JsonResult;
import com.quz.jn_travel.pojo.VO.QRecommendTravel;
import com.quz.jn_travel.service.RecommendService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Controller
@Api("recommend图相关的api")
@RequestMapping("/recommend")
public class RecommendController {

    @Resource
    RecommendService recommendService;

    @ApiOperation("拿到推荐景区数据")
    @GetMapping("/getTravelRecommend")
    @ResponseBody
    public JsonResult getRecommend() {
        List<QRecommendTravel> recommend = recommendService.getRecommend();
        JsonResult jsonResult = new JsonResult(recommend);
        return jsonResult;
    }

    @ApiOperation("拿到推荐景点数据")
    @GetMapping("/getDetailRecommend")
    @ResponseBody
    public JsonResult getRecommendDetail() {
        List<QRecommendTravel> recommend = recommendService.getRecommendDetail();
        JsonResult jsonResult = new JsonResult(recommend);
        return jsonResult;
    }
}
